import "reflect-metadata";
import CollectionInstance from "./Collection";

export function InjectContructor(injectId: string): ParameterDecorator {
  return (targetClass, paramname, parameterIndex) => {
    const constructorParamArr = Reflect.getMetadata(
      "design:paramtypes",
      targetClass
    );
    const construcObj = new constructorParamArr[parameterIndex]();
    CollectionInstance.set(injectId, construcObj);
  };
}
